<%--
  Created by IntelliJ IDEA.
  User: DZP
  Date: 2021/6/9
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>显示产品信息</title>
    <script>
        function fun(val){
            var r=confirm("确认删除吗？");
            if(r){
                location.href="delete?id="+val;
            }
        }
    </script>


</head>

<body>

<div>
    <form action="/search" method="post"
          class="search">
        <input style="border-radius: 0; width: 328px;" name="searchText"
               type="text" placeholder="请输入名称或产地"> <input name="查询商品" type="submit" value="查询商品">
    </form>
</div>

<center>
<table  border='1' cellspacing='0'  style="border:2px solid RGB(73,161,225)">
    <tr>
        <th width="100">编号</th>
        <th width="100">名称</th>
        <th width="100">数量</th>
        <th width="100">价格</th>
        <th colspan="2" width="200">操作</th>
    </tr>
    <c:forEach items="${goods}" var="g" varStatus="st">
        <tr>
            <td>${g.id}</td>
            <td>${g.name}</td>
            <td>${g.amount}</td>
            <td>${g.price}</td>
            <td><a href="updatejsp?id=${g.id}">更新</a></td>
            <td><a href="javascript:void(0);" onclick="fun(${g.id})">删除</a></td>
        </tr>
    </c:forEach>
</table>
</center>
</body>
</html>
